<template>
  <div>
    <van-popup
      v-model="showModal"
      position="bottom"
      :style="{ height: '100%', width: '100%' }"
    >
      <div class="van-header">
        <div class="left">
          <!-- 新增返回列表页 -->
          <van-icon name="arrow-left" size="16" @click="showModal = false" />
        </div>
        <div class="middle">
          <span class="label">物流信息</span>
        </div>
      </div>
      <div class="content">
        <van-steps class="steps" direction="vertical" :active="0">
          <van-step>
            <h3>暂无物流信息，请您稍后再试</h3>
            <!-- <p>{{ data.deliveryTime }}</p> -->
          </van-step>
          <van-step>
            <h3>商家已发货，请等待快递拣货</h3>
            <p>{{ data.deliveryTime }}</p>
          </van-step>
          <van-step>
            <h3>您已支付完成，请等待商家发货</h3>
            <p>{{ data.onlinePayTimeLimit }}</p>
          </van-step>
          <van-step>
            <h3>您提交了订单，请等待系统确认</h3>
            <p>{{ data.createTime }}</p>
          </van-step>
        </van-steps>
      </div>
    </van-popup>
    <full-loading v-if="loading"></full-loading>
  </div>
</template>

<script>
import { queryDelivery } from "@/api/srvAssurance/shoppingMall/order";

export default {
  data() {
    return {
      loading: false,
      showModal: false,
      data: "",
    };
  },
  methods: {
    initData(data) {
      this.showModal = true;
      this.data = data;
      console.log(data);
      this.getCarData(data.orderNo);
    },
    getCarData(val) {
      queryDelivery(val).then((res) => {
        if (res.code === 1000 && res.data) {
          // this.delivery = res.data[0];
        }
      });
    },
  },
};
</script>

<style scoped lang="less">
.van-popup {
  .van-header {
    height: 46px;
    padding: 0 15px;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    line-height: 1;
    .left {
      position: absolute;
      top: 15px;
      left: 15px;
    }
    .middle {
      font-size: 15px;
      flex: 1;
      text-align: center;
    }
  }
  .content {
    height: calc(100% - 46px);
    overflow: auto;
    background-color: #e7e7e7;
    .steps {
      p {
        margin-top: 5px;
      }
    }
  }
}
</style>
